package com.xishu.entity.shop;

import com.xishu.annotation.dao.Search;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.oplog.OpName;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Entity(name = "line_up")
@Table(indexes = {@Index(columnList = "shopId")})
public class LineUp extends AbstractEntity implements OpName {
    private static final long serialVersionUID = 4276843477510460878L;

    @Transient
    private String opName;

    @ApiModelProperty(value = "归属的分店")
    private Long shopId;

    @ApiModelProperty(value = "就餐人数")
    private Integer persons;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "排队所有使用的前缀")
    private String code;

    @ApiModelProperty(value = "排队序列号")
    private Integer serial;

    @ApiModelProperty(value = "正在排队")
    private Boolean lining;

    @ApiModelProperty(value = "会员的ID")
    private Long customerId;

    @Transient
    @ApiModelProperty(value = "排队序列号列表")
    @Search(ignore = true)
    private List<String> codeList;

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public List<String> getCodeList() {
        return codeList;
    }

    public void setCodeList(List<String> codeList) {
        this.codeList = codeList;
    }

    public Integer getPersons() {
        return persons;
    }

    public void setPersons(Integer persons) {
        this.persons = persons;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getSerial() {
        return serial;
    }

    public void setSerial(Integer serial) {
        this.serial = serial;
    }

    public Boolean getLining() {
        return lining;
    }

    public void setLining(Boolean lining) {
        this.lining = lining;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    @Override
    public void setOpName(String str) {
        this.opName = str;
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public String opType() {
        return "排队配置";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"shopId"};
    }
}
